# -*- coding: utf-8 -*-

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import users
from google.appengine.api import memcache
from mako.template import Template
from mako.lookup import TemplateLookup
from common import *
from model import *
import user


class Main(webapp.RequestHandler):
  def get(self):
    global templates
    self.response.out.write(templates.get_template('default.html').render())

class Error404(webapp.RequestHandler):
    def get(self):
        self.response.out.write(templates.get_template('404.html').render())
            
application = webapp.WSGIApplication([
  (r'^/user/(\d+)$', user.Info),
  ('^/my$', user.MyInfo),
  ('^/$', Main),
  ('^/.+$', Error404)
])

def main():
  run_wsgi_app(application)

if __name__ == '__main__':
  main()